/**
 *按题意计算即可
 * 
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using llt = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

int N;
vector<llt> A;
string S;

llt proc(){
    llt ans = 0;
    for(int i=0;i<N;++i){
        if('T' == S[i]){
            ans += A[i];
        }else{
            ans += max(5LL, A[i]/100);
        }
    }
    return ans;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--){
        cin >> N;
        A.assign(N, 0);
        for(auto & i : A) cin >> i;
        cin >> S;
        cout << proc() << "\n";
    }
    return 0;
} 